<?php
$id=intval($_GET['id']);
$sub=video_get_category($id);
$sub['main']['url']=video_url_subcategory($sub['main']['id'],$sub['main']['alias']);

$cat=video_get_category($sub['main']['parent']);
$cat['subcategory']=$sub['main'];


$cache=new cache;


$sub=blog_get_category_of_item($id);
$sub['main']['url']=blog_url_subcategory($sub['main']['id'],$sub['main']['alias']);

$cat=blog_get_category_of_item($sub['main']['parent']);
$cat['subcategory']=$sub['main'];



$og_url=HOME."video/s$id/".$cat['main']['alias']."/";
//-------------------------- GET TRUYEN ----------------
$sql ="SELECT * from blog_video where category=$id and status=1 order by id desc ";
$sql2="SELECT id from blog_video where  category=$id and status=1";

$pager = new Pagination($sql, 20, 5,$og_url,500);
$pager->setDebug(false);
$cache=new cache;
$data[info] = $pager->paginate($cache,$sql2);
$data[nav]	= $pager->renderFullNav();



$data1[title]="Video " . web_title($cat['main']['seo_title']) . " | Xem Video " . web_title($cat['main']['seo_title']) . " tại " . DOMAIN_NAME;
$data1['mota']=web_des($cat['main']['seo_description']);
$data1['keyword']=web_keyword($cat['main']['seo_keyword']);
$data['category']=$cat;

loadview('template/header_video',$data1);
loadview("video/subcategory",$data);
loadview('template/footer_video');
exit();